package com.yykj.base.server.converter;


import com.yykj.base.client.dto.HospitalTypeDTO;
import com.yykj.base.server.model.entity.BaseHospitalType;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

public class HospitalTypeConverter {
    public static HospitalTypeDTO convert(BaseHospitalType baseHospitalType){
        HospitalTypeDTO result = new HospitalTypeDTO();
        BeanUtils.copyProperties(baseHospitalType,result);
        return result;
    }

    public static List<HospitalTypeDTO> convert(List<BaseHospitalType> baseHospitalTypeList){
        return baseHospitalTypeList.stream().map(HospitalTypeConverter::convert)
                .collect(Collectors.toList());
    }


}
